package com.anime.adapter;

import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.Nullable;

import com.animes.R;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import model.AnimeYHSearchModel;
import pic.PicLoadManager;

public  class AnimeYHAdapter  extends BaseQuickAdapter<AnimeYHSearchModel.DataBean.ListBean, BaseViewHolder> {
    public AnimeYHAdapter(int layoutResId, @Nullable @org.jetbrains.annotations.Nullable List<AnimeYHSearchModel.DataBean.ListBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, AnimeYHSearchModel.DataBean.ListBean item) {
        ImageView pig = helper.itemView.findViewById(R.id.iv_content_pig);
        TextView textView = helper.itemView.findViewById(R.id.tv_content_name);
        PicLoadManager.loadPicture(item.getPic(),pig);
        helper.setText(R.id.tv_content_name,item.getName());

        textView.setSelected(true);
    }
}
